package com.hyper_yang._05_juc.chap02;

/**
 * 可重入锁
 */
public class ReentrantLockDemo {

    public synchronized void a(){ // ReentrantLockDemo对象锁
        this.b();
        System.out.println("a");
    }

    public synchronized void b(){ // ReentrantLockDemo对象锁 (同一把
        System.out.println("b");
    }

    public static void main(String[] args) {
        new ReentrantLockDemo().a();
    }
}